<!DOCTYPE html>
<html>
	{include file="head.html"}
	<body>
		<div class="topfixed">
	       <div class="t_left"><a href="/index.php?m=news&a=my" class="goBack"><i class="back"></i></a></div>
	       <div class="t_main">发布新鲜事</div>
	   	   <div class="t_right"><a href="javascript:;" class="t_right_post"  id="post-submit">发送</a></div>
	    </div> 
	    <div class="paddingheight"></div>
	    <div class="main-body" style="background-color: #fff; padding-top: 10px;">
	    	
	    	<div class="textarea-row">

				<div id="js-content" contenteditable="" class="sky-editor-content">{$data.content}</div>
			</div>
	    	{include file="news/uploader.html"}
	    </div>
	    <script src="/plugin/lrz/lrz.bundle.js"></script>
 <script src="/plugin/skyeditor/skyeditor.js"></script>
	    <script>
	    	$(function(){
	    		 
	    		$(document).on("click","#post-submit",function(){
	    			var content=$("#js-content").html();
	    			var imgsdata="";
	    			var im=$("#uploaderFiles .weui-uploader__file");
	    			if(im.length>0){
	    				for(var i=0;i<im.length;i++){
	    					if(i>0){
	    						imgsdata+=",";
	    					}
	    					imgsdata+=im.eq(i).attr("v");	
	    				}
	    			}
	    			$.post("/index.php?m=news&a=save&ajax=1",{
	    				content:content,
	    				imgsdata:imgsdata
	    			},function(data){
	    				skyToast(data.message);
	    				if(data.error==0){
	    					setTimeout(function(){
		    					window.location='/index.php?m=news'
		    				},1000)
	    				}
	    				
	    			},"json");
	    		})
	    	})
	    </script>
	</body>
</html>
